﻿
using Dapper;
using HBase; 
using System.Data;
using System.Diagnostics;
using System.Linq;
namespace hCommand
{
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：Component                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2020/9/2 11:28:16                        
   *└────────────────────────────────────────────────┘
   **/
    public class CraneMoveEngine<CS> : AbsTaskCSEngine where CS : AbsCoreStock  {
        public long stockId;
        public int des;

        protected override StockStatus change2Status() {
            throw new System.NotImplementedException();
        }

        protected override TransRes Execute( ) {
             
        
            CS cs = getById<CS>(stockId);
 
            if(cs == null ) {
                return new TransRes("stock 为空");
            }

            if ((int)StockStatus.库存 != cs.status) {
                return new TransRes("stock 状态异常");
            }
            
            CoreWhLoc loc = getById<CoreWhLoc>(des);
           
            if( loc == null ) {
                return new TransRes("货位获取异常");

            }
            if (loc.countStock != 0) {
                return new TransRes("目标货位库存异常");
            }
            locMoreMove(cs, des);

            
            return new TransRes();
        }

    }
}
